<template>
    <view class="main">
        <view class="con dispaly-col-center">
            <view class="avatar">
                <image src="/static/icon/op1.png" mode="aspectFill" />
            </view>
            <view class="version">{{ version }}</view>
            <view class="desc">
                <rich-text :nodes="p"></rich-text>
            </view>
        </view>
        <view class="se">
            <view class="title dispaly-center">
                <view class="line"></view>
                <view class="txt">服务点列表</view>
            </view>
            <Empty v-if="!dataList.length" />
            <serverCard v-for="item in dataList" :data="item" :key="item.id" v-else />
        </view>
    </view>
</template>

<script setup>
import { serverPointList, proxy } from '@/api/apiList'
import serverCard from '@/components/serverCard/serverCard.vue';
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';

let dataList = ref([])
const getList = async () => {
    const res = await serverPointList()
    if (res.code == 200) {
        dataList.value = res.data
    }
}

const p = ref('')
const getProxy = async () => {
    const res = await proxy('platform')
    if (res.code == 200) {
        p.value = res.msg
    }
}

let version = ref('')
onLoad(() => {
    getList()
    getProxy()
    const accountInfo = uni.getAccountInfoSync();
    version.value = accountInfo.version || 'v1.1.9'
    console.log(accountInfo, 'ass')
})
</script>
<style lang="scss" scoped>
.main {
    .con {
        background-color: #fff;
        margin-bottom: 30rpx;

        .avatar {
            margin-top: 60rpx;

            image {
                width: 118rpx;
                height: 118rpx;
                border-radius: 18rpx;
            }
        }

        .version {
            margin: 30rpx 0 60rpx 0;
            font-family: PingFang-SC, PingFang-SC;
            font-weight: 500;
            font-size: 30rpx;
            color: #8E8E8E;
        }

        .desc {
            padding: 50rpx 88rpx 30rpx 88rpx;

            font-family: PingFang-SC, PingFang-SC;
            font-weight: 500;
            font-size: 24rpx;
            color: #111111;
            line-height: 48rpx;
        }
    }

    .se {
        padding: 30rpx;

        .title {
            margin-bottom: 20rpx;

            .line {
                margin-right: 10rpx;
                width: 8rpx;
                height: 24rpx;
                background: radial-gradient(#FB4E47 0%, #FFFFFF 100%);
                border-radius: 4rpx 4rpx 4rpx 4rpx;
            }

            .txt {
                font-family: PingFang-SC, PingFang-SC;
                font-weight: bold;
                font-size: 28rpx;
                color: #222222;
            }
        }
    }
}
</style>